<!--
 * @Author: hu_binbin
 * @Date: 2021-08-05 14:05:03
 * @LastEditTime: 2021-08-21 15:18:24
 * @Description: 关注信息
-->

<template>
	<article class="bg_4dbfae">
        <!-- 标题-->
        <div class="title-bg">
			<Theader :title="title" :headerStyle="{color:'#fff'}" :textStyle="{color:'#fff'}" :titleStyle="{color:'#fff'}">
				<template slot="header_arrow">
					<van-icon size="25" name="arrow-left" @click="back" />
				</template>
				<template slot="header_icon">
					<van-image class="imgSize" width="23" height="23" @click="rfidBtn" :src="icon.rfid" />
                    <van-image class="imgSize" width="20" height="20" @click="scanBtn" :src="icon.scan" />
				</template>
			</Theader>
        </div>
        <!-- 菜单-->
        <div class="work">
            <van-cell @click="showScreenPage">
				<template slot="title">
                    <span class="line_green"></span>
                    <label class="title-label">正在开展工作</label>
                </template>
                <template slot="default">
                    <van-button type="primary" size="mini" 
                    :style="{color:workDate == 0 ? '#FFFFFF' : '#666'}" 
                    :color="workDate == 0 ? '#0EB295' : '#F0F0F0'">本周</van-button>
                    <van-button type="primary" size="mini" 
                    :style="{color:workDate != 0 ? '#FFFFFF' : '#666'}" 
                    :color="workDate != 0 ? '#0EB295' : '#F0F0F0'">本日</van-button>
				</template>
            </van-cell>
            <van-tabs v-model="active" style="width: 6rem;" color="#0EB295" title-active-color="#0EB295" animated swipeable>
                <van-tab  title="本班"></van-tab>
                <van-tab  title="本人"></van-tab>
            </van-tabs>
            <div class="operClass">
                <div class="operTicket">
                    <van-image :src="icon.operTicket" width="26" height="26"></van-image>
                    <span>操作票</span>
                    <span class="border"></span>
                    <label><font class="color-blue">16</font>个</label>
                </div>
                <div class="workTicket">
                    <van-image :src="icon.workTicket" width="26" height="26"></van-image>
                    <span>工作票</span>
                    <span class="border"></span>
                    <label><font class="color-green">16</font>个</label>
                </div>
            </div>
            <!-- 柱状图 -->
            <barEchars :datasource="barEcharData"></barEchars>
        </div>
        <!--运行值班统计-->
        <div class="content">
            <van-cell>
				<template slot="title">
                    <span class="line_green"></span>
                    <label class="title-label">运行值班统计</label>
                </template>
                <template slot="default">
                    <van-button type="primary" size="mini" 
                    :style="{color:statiDate == 0 ? '#FFFFFF' : '#666'}" 
                    :color="statiDate == 0 ? '#0EB295' : '#F0F0F0'">本周</van-button>
                    <van-button type="primary" size="mini" 
                    :style="{color:statiDate == 1 ? '#FFFFFF' : '#666'}" 
                    :color="statiDate == 1 ? '#0EB295' : '#F0F0F0'">本月</van-button>
                    <van-button type="primary" size="mini" 
                    :style="{color:statiDate == 2 ? '#FFFFFF' : '#666'}" 
                    :color="statiDate == 2 ? '#0EB295' : '#F0F0F0'">本年</van-button>
				</template>
            </van-cell>
            <div class="plan">
                <div class="record">
                    <div class="name">运维计划</div>
                    <div class="cont">
                        <span>总数：<font class="color-green">34</font></span>
                        <label>未完成：<font class="color-orange">21</font></label>
                    </div>
                </div>
                <div class="record">
                    <div class="name">运行记录</div>
                    <div class="cont">
                        <span>总数：<font class="color-green">34</font></span>
                        <label>未完成：<font class="color-orange">21</font></label>
                    </div>
                </div>
            </div>
        </div>
        <!--运行概况-->
        <div style="height: calc(100% - 40rem);">
            <van-cell>
				<template slot="title">
                    <span class="line_green"></span>
                    <label class="title-label">运行概况</label>
                </template>
                <template slot="default">
                    <van-button type="primary" size="mini" 
                    :style="{color:general == 0 ? '#FFFFFF' : '#666'}" 
                    :color="general == 0 ? '#0EB295' : '#F0F0F0'">本周</van-button>
                    <van-button type="primary" size="mini" 
                    :style="{color:general == 1 ? '#FFFFFF' : '#666'}" 
                    :color="general == 1 ? '#0EB295' : '#F0F0F0'">本月</van-button>
                    <van-button type="primary" size="mini" 
                    :style="{color:general == 2 ? '#FFFFFF' : '#666'}" 
                    :color="general == 2 ? '#0EB295' : '#F0F0F0'">本年</van-button>
				</template>
            </van-cell>
            <div style="height: 100%;overflow: auto;">
                <!--缺陷-->
                <circleEcharsDefect :datasource="circleEcharDefectData"></circleEcharsDefect>
                <!--隐患-->
                <circleEcharsHidden  :data="circleEcharHiddenData"></circleEcharsHidden>
            </div>
        </div>
        <Tabbar></Tabbar>
	</article>
</template>

<script type="text/javascript">
    import Theader from "../component/header"
    import Tabbar from '@/components/tabbar'
    import circleEcharsDefect from "../component/circleEcharsDefect"
    import circleEcharsHidden from "../component/circleEcharsHidden"
    import barEchars from "../component/barEchars"
	export default {
		name: 'tourIndex',
		components: {
            Theader,
            circleEcharsDefect,
            circleEcharsHidden,
            barEchars,
            Tabbar
		},
		data() {
			return {
				active: 0,
				title: "变电运维应用",
				icon: {
					rfid:require('../../../../assets/tour/rifid.png'),
                    scan:require('../../../../assets/tour/scan.png'),
                    operTicket:require('../../../../assets/tour/concern-blue.png'),
                    workTicket:require('../../../../assets/tour/concern-green.png'),
                    
                },
                workName: "",
                workDate: 0,//工作日期
                statiDate: 0,//统计日期
                general:0,//运行概况
                circleEcharDefectData: [
                    {value: 13, name: '一般缺陷'},
                    {value: 7, name: '严重缺陷'},
                    {value: 9, name: '危急缺陷'},
                ],
                circleEcharHiddenData: [
                    {value: 13, name: '一般隐患'},
                    {value: 7, name: '严重隐患'},
                    {value: 9, name: '危急隐患'},
                ],
                barEcharData: [11, 6, 13, 14, 22]
			}
		},
		
		computed: {
			
		},
		
		methods: {
            /**
            * @description: rifid
            * @param {*}
            * @return {*}
            */         
			rfidBtn() {

            },
            /**
             * @description: 扫一扫
             * @param {*}
             * @return {*}
             */
            scanBtn() {

			},
			showScreenPage() {

            },
            /**
             * @description: 返回
             * @param {*}
             * @return {*}
             */
            back() {
                
            }
		},
		
		watch: {
			
		},
		mounted() {
			
		},
		created() {

		},
		
	}
</script>

<style scoped>
	article {
        height: 100vh;
	}
	.bg_4dbfae{
		background: #fff !important;
	}
	.title-bg{
		height: 130px;
		width: 100%;
		background-image: url("../../../../assets/tour/bg-shadow.png");
		background-repeat: no-repeat, no-repeat, no-repeat;
        background-size: 100% 100%;
	}
	.work{
		position: relative;
		top: -5rem;
		margin-left: 15px;
		margin-right: 15px;
		background: #fff;
		box-shadow: 0px 0px 4px 2px #e0e0e0;
    	border-radius: 5px;
    }
    .van-cell{
        line-height: 16px;
    }
    .operClass{
        display: flex;
        margin: 0.6rem;
        align-items: center;
        justify-content: space-around;
    }
    .operClass .operTicket, .operClass .workTicket{
        font-size: 13px;
        width: 40%;
        display: flex;
        padding: 0.6rem;
        align-items: center;
        border-radius: 4px;
        background: #F5F6F7;  
        justify-content: space-around;  
    }
    .operClass label{
        color: #333;
    }
    .operClass span{
        color: #333;
    }
    .color-blue{
        color:#1481EE; 
    }
    .color-green{
        color:#19C169; 
    }
    .color-orange{
        color:#FFAA00; 
    }
    .border{
        height: 13px;
        border-right: 1px solid #ccc;
    }
    .content{
        margin-top: -19%;
    }
    .plan{
        margin: 0.6rem;
        display: flex;
        align-items: center;
        justify-content: space-around;
    }
    .record{
        width: 40%;
        padding: 0.6rem;
        background: #F5F6F7;
        text-align: center;
    }
    .record .name{
        font-size: 13px;
        color: #333;
    }
    .record .cont{
        margin-top: 0.5rem;
        font-size: 11px;
        color: #999;
    }
</style>
